package zh.javadesign.工厂方法.impl02.store;

import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import zh.javadesign.工厂方法.Scene.card.IQiYiCardService;

import java.util.Map;

/**
 * Copyright (C) 广州中和互联网技术有限公司
 *
 * @author 范家微 fanjiawei@borche.cn
 * @date :2021/1/29 11:34
 */
@Slf4j
public class CardCommodityService implements ICommondity {
	@Override
	public void sentCommodity(String uId, String commodityId, String bizId, Map<String, String> extMap) {
		IQiYiCardService iQiYiCardService = new IQiYiCardService();
		iQiYiCardService.grantToken(queryUserMobile(uId),commodityId);
		log.info("请求参数[爱奇艺兑换卡] => uId：{} commodityId：{} bizId：{} extMap：{}", uId, commodityId, bizId, JSON.toJSON(extMap));
		log.info("测试结果[爱奇艺兑换卡]：success");
	}
	private String queryUserMobile(String uId) {
		return "15200101232";
	}
}
